from django.urls import path

from prj005.views import (
    InfoView, ClinicalView, CureView,
    HistoryView, RelevantView, ResultView,
    SummaryView, FileOutView, SearchView,
    ChartInfoView, MobileView
)

many_view_func = {
    'get': 'list',
    'post': 'create'
}

single_view_func = {
    'get': 'retrieve',
    'patch': 'partial_update',
    'delete': 'destroy'
}

urlpatterns = [
    path('mobile/', MobileView.as_view({'post': 'create'}), name='prj004-mobile-create'),

    path('charts/', ChartInfoView.as_view({'get': 'get'}), name='prj005-chart-detail'),

    path('search/', SearchView.as_view({'post': 'list'}), name='prj005-info-search'),

    path('fileout/', FileOutView.as_view({'get': 'list'}), name='prj005-info-fileout'),

    path('info/check/<int:pk>/', InfoView.as_view({'post': 'check'}), name='prj005-info-check'),

    path('info/', InfoView.as_view(many_view_func), name='prj005-info'),
    path('info/<int:pk>/', InfoView.as_view(single_view_func), name='prj005-info-detail'),

    path('clinical/', ClinicalView.as_view(many_view_func), name='prj005-clinical'),
    path('clinical/<int:pk>/', ClinicalView.as_view(single_view_func), name='prj005-clinical-detail'),

    path('cure/', CureView.as_view(many_view_func), name='prj005-cure'),
    path('cure/<int:pk>/', CureView.as_view(single_view_func), name='prj005-cure-detail'),

    path('history/', HistoryView.as_view(many_view_func), name='prj005-history'),
    path('history/<int:pk>/', HistoryView.as_view(single_view_func), name='prj005-history-detail'),

    path('relevant/', RelevantView.as_view(many_view_func), name='prj005-relevant'),
    path('relevant/<int:pk>/', RelevantView.as_view(single_view_func), name='prj005-relevant-detail'),

    path('result/', ResultView.as_view(many_view_func), name='prj005-result'),
    path('result/<int:pk>/', ResultView.as_view(single_view_func), name='prj005-result-detail'),

    path('summary/', SummaryView.as_view(many_view_func), name='prj005-summary'),
    path('summary/<int:pk>/', SummaryView.as_view(single_view_func), name='prj005-summary-detail'),

]
